home *** CD-ROM | disk | FTP | other *** search
/ Secrets of Stargate / STARGATE.iso / mac / STARGATE (5MB Macintosh) / STARGATE (5MB Macintosh).DXR / 00005_Stage Scripts.ls < prev    next >
Encoding:
Text File  |  1994-10-19  |  3.8 KB  |  144 lines

  1. on movCatClick sN
  2.   if voidp(sN) then
  3.     set sN to the clickOn
  4.   end if
  5.   hiliteAnim(sN, EMPTY)
  6.   set theCat to line sN - 8 of field "MOVTXT_CN"
  7.   if theCat = "Interviews" then
  8.     openIV()
  9.   else
  10.     LoadStageCat(theCat)
  11.   end if
  12. end
  13.  
  14. on LinkStageFromLine theLine
  15.   global gStageCategory, gStageData, gStageRecs, gStageState, gLinkBack
  16.   if theLine = -1 then
  17.     exit
  18.   end if
  19.   spinCursor()
  20.   set numRecs to the number of items in gStageRecs
  21.   set curRecord to value(item theLine of gStageRecs)
  22.   spinCursor()
  23.   put curRecord & RETURN & theLine & RETURN & numRecs into line 1 to 3 of gStageState
  24.   set gLinkBack to "LinkTo " & QUOTE & the frameLabel & QUOTE
  25.   showQT(curRecord)
  26.   startMouse()
  27. end
  28.  
  29. on LoadStageCat theCat
  30.   global gResourcePath, gStageCategory, gStageRecs
  31.   set gStageCategory to theCat
  32.   set theLine to LineOffset(gStageCategory, field "MOVTXT_CN")
  33.   set gStageRecs to line value(theLine) of field "MOVTXT_CD"
  34.   LinkTo("Stage " & value(theLine))
  35. end
  36.  
  37. on showQT theRec
  38.   global gLinkBack, gStageNum, gOnPC, gSysVol, gVideoDouble, gMovieStartMod, gMovUserViewed, gLastPalette
  39.   spinCursor()
  40.   stopAiff()
  41.   hidePuppets()
  42.   set firstFrame to label("Stage BG") - 1
  43.   set theData to line theRec of field "MOVTXT_1"
  44.   debug("R: " & theRec)
  45.   set the itemDelimiter to "|"
  46.   set theFile to item 1 of theData
  47.   if getOne(gMovUserViewed, theFile) = 0 then
  48.     add(gMovUserViewed, theFile)
  49.   end if
  50.   set newPal to item 2 of theData
  51.   set theLoop to item 5 of theData
  52.   set frameNum to item 7 of theData
  53.   set theCaption to putBackChars(item 8 of theData)
  54.   set theVolume to item 9 of theData
  55.   set canDouble to value(item 10 of theData)
  56.   put theCaption into field "Stage Caption"
  57.   set the itemDelimiter to ","
  58.   set the visible of sprite 35 to 0
  59.   puppetPalette(value(the framePalette))
  60.   go("Black Stage")
  61.   set gLastPalette to value(the number of cast newPal)
  62.   pause()
  63.   puppetPalette(gLastPalette)
  64.   dissolveEffect()
  65.   go(frameNum + firstFrame)
  66.   puppetPalette(gLastPalette)
  67.   updatePalette()
  68.   if (gVideoDouble = 1) and (canDouble = 1) then
  69.     puppetSprite(35, 1)
  70.     set the castNum of sprite 35 to the castNum of sprite 35
  71.     set centerPoint to point(the locH of sprite 35, the locV of sprite 35)
  72.     set the rect of sprite 35 to (2 * the rect of sprite 35) - rect(centerPoint, centerPoint)
  73.   end if
  74.   set the movieTime of sprite 35 to gMovieStartMod
  75.   set the visible of sprite 35 to 1
  76.   if gOnPC = 1 then
  77.     puppetPalette(gLastPalette)
  78.     set the visible of sprite 35 to 1
  79.   end if
  80.   updateStage()
  81.   set letPass to 0
  82.   if theVolume = EMPTY then
  83.     set theVolume to gSysVol
  84.   else
  85.     set theVolume to integer(gSysVol * (float(theVolume) / float(255)))
  86.     set theVolume to integer(theVolume * 1.5)
  87.     if theVolume > 255 then
  88.       set theVolume to 255
  89.     end if
  90.   end if
  91.   set the volume of sprite 35 to 0
  92.   updateStage()
  93.   continue()
  94.   stopCursor()
  95.   preRollMov(35)
  96.   set the volume of sprite 35 to theVolume
  97.   repeat while the movieRate of sprite 35 > 0
  98.     if the mouseDown then
  99.       set letPass to 1
  100.       set the movieRate of sprite 35 to 0
  101.       exit repeat
  102.     end if
  103.     updateStage()
  104.   end repeat
  105.   spinCursor()
  106.   set the visible of sprite 35 to 0
  107.   if gVideoDouble = 1 then
  108.     puppetSprite(35, 0)
  109.   end if
  110.   puppetPalette(gLastPalette)
  111.   updatePalette()
  112.   pause()
  113.   dissolveEffect()
  114.   if gOnPC then
  115.     LinkTo("Black Stage")
  116.   else
  117.     go("Black Stage")
  118.   end if
  119.   puppetPalette(0)
  120.   continue()
  121.   if (letPass <> 1) or (clickInStage() = 0) then
  122.     movieDone()
  123.   end if
  124. end
  125.  
  126. on clickInStage
  127.   set a to the clickLoc
  128.   delete char 1 to 6 of a
  129.   delete char the length of a of a
  130.   set sL to the stageLeft
  131.   set sT to the stageTop
  132.   put integer(value(item 1 of a + sL)) into item 1 of a
  133.   put integer(value(item 2 of a + sT)) into item 2 of a
  134.   put "point(" before a
  135.   put ")" after a
  136.   set r to inside(value(a), the rect of the stage)
  137.   return r
  138. end
  139.  
  140. on movieDone
  141.   LinkBack()
  142.   resetCursor()
  143. end
  144.